package com.xmtlxx.tms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.tms.domain.Waybill;
import com.xmtlxx.tms.domain.bo.WaybillBo;
import com.xmtlxx.tms.domain.vo.WaybillVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 运单Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface WaybillMapper extends BaseMapperPlus<WaybillMapper, Waybill, WaybillVo> {
    /**
     * 根据条件分页查询运单
     *
     * @param waybill 运单
     * @return Page Waybill
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "w.create_by"),
//        @DataColumn(key = "deptName", value = "o.carrier_dept_id"),
        @DataColumn(key = "userName", value = "w.create_by")
    })
    Page<WaybillVo> selectPageWaybillList(@Param("page") Page<Waybill> page,@Param("waybill") WaybillBo waybill);

    String getTaskVideoStatus(@Param("id") String id);

    /**
     * 查询运单列表
     *
     * @param waybill 运单
     * @return 运单集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "w.create_by"),
//        @DataColumn(key = "deptName", value = "o.carrier_dept_id"),
        @DataColumn(key = "userName", value = "w.create_by")
    })
    List<WaybillVo> selectWaybillList(@Param("waybill") WaybillBo waybill);

    WaybillVo selectWaybillVoByID(String id);

    WaybillVo selectWaybillVoByOrderID(String id);

    List<WaybillVo> waybillStatistics();

    List<WaybillVo> selectWaybillVoByOrderId(String orderId);

    List<WaybillVo> getSignByWaybill(@Param("boxNo") String boxNo,@Param("status") String status);

    Waybill selectWaybillByOrderId(String orderId);

    int updateWaybill(@Param("waybill") Waybill waybill);

    void removeWayBill(String id);
}
